import { WatchSizeStrategyConst } from './consts'

export const WatchSizeStrategyConstType_Name = 'WatchSizeStrategyConstType'
export const SizeUpdateHandlerType_Name = 'SizeUpdateHandlerType'
export const WatchSizePropsType_Name = 'WatchSizePropsType'

export type WatchSizeStrategyConstType =
  (typeof WatchSizeStrategyConst)[keyof typeof WatchSizeStrategyConst]

export type SizeUpdateHandlerType = (size: number) => void

export type WatchSizePropsType = {
  // 监听大小变化的策略
  strategy?: WatchSizeStrategyConstType
  // 宽度变化时的处理函数
  widthUpdateHandler?: SizeUpdateHandlerType
  // 高度变化时的处理函数
  heightUpdateHandler?: SizeUpdateHandlerType
  // 是否组件挂载后立即开启监听
  immediate?: boolean
  // 是否禁用监听
  disabled?: boolean
}
